home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / feel0_89.lha / Feel / Modules / xread.em < prev    next >
Lisp/Scheme  |  1993-07-13  |  546b  |  32 lines

  1. ;; Eulisp Module
  2. ;; Author: pab
  3. ;; File: xread.em
  4. ;; Date: Sun May 16 09:37:58 1993
  5. ;;
  6. ;; Project:
  7. ;; Description: 
  8. ;;
  9.  
  10. (defmodule xread
  11.   (standard0
  12.          
  13.    )
  14.   ()
  15.   
  16.  
  17.   ;; NB: Plenty of scope for bugs here
  18.   ;;     If we switch cpus for any reason (like a GC) we are sunk...
  19.   
  20.   (defun xread (prompt)
  21.     (let ((stream (popen (format nil "xprompt -p ~a" prompt) 'input)))
  22.       (if (null stream)
  23.       (format t "Whups..")
  24.     (let ((res (read stream)))
  25.       (format t "~a -> ~a~%" prompt res)
  26.       res))))
  27.   
  28.   (export xread)
  29.  
  30.   ;; end module
  31.   )
  32.